package com.demo.config;

import com.demo.condition.LinuxCondition;
import com.demo.condition.WindowsCondition;
import com.demo.serviceI.DemoService;
import com.demo.serviceImp.DemoServiceLinuxImp;
import com.demo.serviceImp.DemoServiceWindowImp;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OSconfig {

    @Bean
    @Conditional(LinuxCondition.class)
    public DemoService linuxCondition(){
        return new DemoServiceLinuxImp();
    }

    @Bean
    @Conditional(WindowsCondition.class)
    public DemoService winCondition(){
        return new DemoServiceWindowImp();
    }


}
